<!--
/**
 * moOde audio player (C) 2014 Tim Curtis
 * http://moodeaudio.org
 *
 * This Program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3, or (at your option)
 * any later version.
 *
 * This Program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * 汉化：Androidnews
 */
-->
<div id="container">
<div class="container">
	<h1 class="lib-config">音乐源</h1>
	<p>
		指定在网络上共享歌曲文件的远程主机的路径。
		保存或删除音乐源后，返回播放或曲库，然后从菜单中选择“更新曲库”。
	</p>

	<form class="form-horizontal" action="lib-config.php" method="post">
		<legend>远程主机
			<button class="legend-config btn btn-medium btn-primary btn-submit" type="submit" name="save" value="1">保存</button>
			<a href="#remove-source" data-toggle="modal" class="$_hide_remove"><button class="legend-config btn btn-medium btn-primary">移除</button></a>
		</legend>

		<a data-toggle="modal" href="#moode-log" class="btn btn-medium config-btn $_hide_error" style="background-color: #333;">
			<i class="fa-solid fa-sharp fa-times red sx"></i>单击查看加载错误
		</a>

		<div class="control-group">
			<label class="control-label" for="type">类型</label>
			<div class="controls">
				<select id="type" name="mount[type]" class="config-select-large">
					$_protocol
				</select>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-fileshare-protocol" href="#notarget"><i class="fa-solid fa-sharp fa-info-circle"></i></a>
				<span id="info-fileshare-protocol" class="config-help-info">
					选择与远程主机上使用的文件共享协议相对应的类型。
					请注意，失败的NFS加载可能会导致长达2分钟的超时。发生这种情况时，该屏幕将显示为挂起。
                </span>
			</div>

			<label class="control-label" id="server-label" for="address">路径</label>
			<div class="controls">
				<select id="address" name="mount[address]" class="config-select-large">
					$_address
				</select>
				<button id="scan-btn" class="btn btn-primary btn-small config-btn-set btn-submit status-msg $_scan_btn_hide" data-msg="Scan in progress" type="submit" name="scan" value="1">扫描</button>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-server" href="#notarget"><i class="fa-solid fa-sharp fa-info-circle"></i></a>
				<span id="info-server" class="config-help-info">
					扫描生成网络上找到的SMB或NFS共享的路径列表。
					路径包括主机或IP地址，后跟一个正斜杠，再跟一个共享名
					例如某个主机/共享名。
                </span>
				<div id="edit-server" $_edit_server_hide">
					<a id="editserver" data-toggle="modal" href="#manual-server"><button class="btn btn-medium btn-primary config-btn" >编辑</button></a>
					<span class="config-btn-after">手动路径</span>
				</div>
			</div>

			<div id="userid-password" class="$_userid_pwd_hide">
				<label class="control-label" for="nas-usr">用户标识</label>
				<div class="controls">
					<input  id="nas-usr" class="config-input-large" type="text" pattern="[^'\u0022]+" name="mount[username]" value="$_username">
					<a aria-label="Help" class="config-info-toggle" data-cmd="info-nas-uidpwd" href="#notarget"><i class="fa-solid fa-sharp fa-info-circle"></i></a>
				</div>

				<label class="control-label" for="nas-pasw">密码</label>
				<div class="controls">
					<input  id="nas-pasw" class="config-input-large" type="password" pattern="[^'\u0022]+" name="mount[password]" value="$_password" autocomplete="off">
					<a aria-label="Help" class="config-info-toggle" data-cmd="info-nas-uidpwd" href="#notarget"><i class="fa-solid fa-sharp fa-info-circle"></i></a>
					<a class="show-hide-password" href="#notarget" data-id="nas-pasw"><i class="fa-regular fa-sharp fa-eye"></i></a>
					<span id="info-nas-uidpwd" class="config-help-info">
						除非您的NAS设备需要特定的用户id/密码，否则请尝试用户id Guest和空白密码。
						注意不允许使用单引号和双引号。
		            </span>
				</div>
			</div>

			<label class="control-label" for="nas-name">名称</label>
			<div class="controls">
				<input class="config-input-large" type="text" pattern="[A-Za-z0-9\-]{1,25}" id="nas-name" name="mount[name]" value="$_name">
				<input type="hidden" name="mount[id]" value="$_id">
				<input type="hidden" name="mount[action]" value="$_action">
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-source-name" href="#notarget"><i class="fa-solid fa-sharp fa-info-circle"></i></a>
				<span id="info-source-name" class="config-help-info">
					此音乐源的友好名称（别名）。该名称将显示在NAS文件夹下的库文件夹视图中。
					格式为1-25个字符，允许字母数字和连字符。
                </span>
			</div>
		</div>

		<div id="advanced-options" class="$_advanced_options_hide">
			<legend>高级
				<button class="legend-config btn btn-medium btn-primary btn-submit" type="submit" name="save" value="1">保存</button>
			</legend>

			<div class="control-group">
				<label class="control-label" for="nas-charset">字符编码</label>
				<div class="controls">
					<select id="nas-charset" name="mount[charset]" class="config-select-large">
						<option value="utf8" $_charset>UTF-8 (Default)</option>
						<option value="iso8859-1" $_charset>ISO-8859-1</option>
					</select>
					<a aria-label="Help" class="config-info-toggle" data-cmd="info-mount-charset" href="#notarget"><i class="fa-solid fa-sharp fa-info-circle"></i></a>
					<span id="info-mount-charset" class="config-help-info">
						此设置决定字符的编码方式。默认值为UTF-8，这是一种多字节编码，可以表示任何Unicode字符。O 8859-1是一种单字节编码，可以表示前256个Unicode字符。两者的ASCII编码方式完全相同。
                    </span>
				</div>

				<div id="rw-size" class="$_rw_size_hide">
					<label class="control-label" for="nas-rsize">Rsize</label>
					<div class="controls">
						<input class="config-input-large" type="number" id="nas-rsize" name="mount[rsize]" value="$_rsize">
						<a aria-label="Help" class="config-info-toggle" data-cmd="info-mount-rsize" href="#notarget"><i class="fa-solid fa-sharp fa-info-circle"></i></a>
						<span id="info-mount-rsize" class="config-help-info">
							此设置的默认值为61440。
	                    </span>
					</div>

					<label class="control-label" for="nas-wsize">Wsize</label>
					<div class="controls">
						<input class="config-input-large" type="number" id="nas-wsize" name="mount[wsize]" value="$_wsize">
						<a aria-label="Help" class="config-info-toggle" data-cmd="info-mount-wsize" href="#notarget"><i class="fa-solid fa-sharp fa-info-circle"></i></a>
						<span id="info-mount-wsize" class="config-help-info">
							此设置的默认值为65536。
	                    </span>
					</div>
				</div>

				<label class="control-label" for="options">加载选项</label>
				<div class="controls">
					<input class="config-input-large" type="text" id="options" name="mount[options]" value="$_options">
					<span id="info-mount-flags" class="config-help-static">
						尝试加载时，大多数加载选项会自动协商，但在某些情况下，自动协商无法确定正确的值，加载可能会失败。在这种情况下，必须明确添加某些选项。下面列出了其中一些。<br>
						SMB: vers=x.y, sec=ntlm or sec=ntlmssp<br>
						NFS: vers=x.y, type=nfs2, nfs3 or nfs4
                    </span>
				</div>
			</div>
		</div>
	</form>
</div>
</div>

<form class="form-horizontal" method="post">
	<div id="remove-source" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="remove-source-label" aria-hidden="true">
		<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			<h3>移除音乐源: $_name?</h3>
		</div>
		<div class="modal-body"></div>
		<div class="modal-footer">
			<button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
			<button class="btn btn-primary btn-submit" type="submit" name="delete" value="1">是</button>
		</div>
	</div>
</form>

<div id="moode-log" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="moode-log-label" aria-hidden="true">
	<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		<h3>Moode日志</h3>
	</div>
	<div class="modal-body">
		<pre>
			$_moode_log
		</pre>
	</div>
	<div class="modal-footer">
		<button class="btn singleton" data-dismiss="modal" aria-hidden="true">关闭</button>
	</div>
</div>

<form class="form-horizontal" method="post">
	<div id="manual-server" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="manual-server-label" aria-hidden="true">
		<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			<h3>手动输入路径</h3>
		</div>
		<div class="modal-body">
			<label class="control-label" for="manualserver">路径</label>
			<div class="controls">
				<input id="manualserver" class="config-input-xlarge config-modal-input" type="text" pattern="^[A-Za-z0-9]{1,1}.*$" name="nas_manualserver" value="" autofocus>
				<input id="mounttype" type="hidden" name="mounttype" value="">
				<div id="info-manualserver" class="help-block" style="margin-top:5px;">
					格式为主机/共享或IP地址/共享。最多64个字符，不允许有前导斜杠/字符。
                </div>
			</div>
		</div>
		<div class="modal-footer">
			<button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
			<button class="btn btn-primary btn-submit" type="submit" name="manualentry" value="1">是</button>
		</div>
	</div>
</form>
